home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 22
/
Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso
/
Aminet
/
comm
/
cnet
/
fallout.lha
/
FallOut
next >
Wrap
Text File
|
1997-09-04
|
5KB
|
115 lines
/**************************************************************************\
$VER: Fall Out, v2.20 (4-Sep-97) by Dotoran!
\**************************************************************************/
options results;signal on SYNTAX;signal on ERROR;signal on IOERR
a=sourceline(2);parse var a . ", "ver" ("vdate")" .;a=random(,,time("s"))
tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch;qu=query
a="rexxsupport.library";if ~show("l",a) then if ~addlib(a,0,-30) then exit
parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
BEGIN:
tr "f1n1" ; call SETUP ; call DISPLAY2 ; call UPDATE
MOVE:
if done=0 then signal WIN ; else tr "HcbMove! "
tr "HcfTurns: ca"turns"HcfTo Go: ce"done
se "18HcfSlide which Row? cb(ce1cb-ce9cb/c9Qcb)cf:ce h4"
gc ; a=result ; call CHECK ; r=index("123456789Q",a)
if r=0 | r=10 then do ; tr "c9Quit" ; signal QUIT ; end ; else tr r
se "18HceHow many Spaces? cb(cf1cb-cf9cb/c9Qcb)ce:cf h4"
gc ; a=result ; call CHECK ; s=index("123456789Q",a)
if s=0 | s=10 then do ; tr "c9Quit" ; signal QUIT ; end ; else tr s
se "18HcfRight of Left? cb(ceRcb/cd[ceLcd]cb/c9Qcb)cf:ce h5"
gc ; a=result ; call CHECK ; d=index("RLQ",a) ; if d=0 then d=2
if d=3 then do ; tr "c9Quit" ; signal QUIT ; end
if d=1 then do ; tr "Right"
l1=right(l.r,s*3) ; l2=left(l.r,27-s*3) ; l.r=l1||l2 ; end
if d=2 then do ; tr "Left"
l1=left(l.r,s*3) ; l2=substr(l.r,s*3+1) ; l.r=l2||l1 ; end
call DISPLAY ; call UPDATE ; turns=turns+1
signal MOVE
WIN:
tr "18HcfYou did it in ce"turns" cfturns!n1"
se "18HcfWant to Play Again? cb(ceYcb/cencb)cf: ce"
gc ; a=result ; call CHECK
if a="N" then do ; tr "No." ; bufferflush ; exit ; end
tr "Yes!" ; signal BEGIN
exit
QUIT:
se "1HcfQuit? ce(cbyce/cbNce)cf: ce"
gc ; a=result ; call CHECK
if a~="Y" then do ; tr "No.h8h8" ; signal MOVE ; end
tr "Yes!n9" ; bufferflush
exit
UPDATE:
do i=9 to 1 by -1 ; ii=i-1
a1=index(l.i," ") ; if a1=0 then iterate i
b1=substr(l.ii,a1,3) ; tr "HcfThink: c9"a1"cf-cd"b1
if b1~=" " & b1~="°±²" then do ; flag=1 ; if i=9 then flag2=1
l.i=overlay(b1,l.i,a1,3) ; l.ii=overlay(" ",l.ii,a1,3) ; end
end i ; call DISPLAY ; if flag=1 then do ; flag=0 ; signal UPDATE ; end
if flag2=0 then return
do i=1 to 9 ; a=substr(l.9,i*3-2,3)
b=index("{1}{2}{3}{4}{5}{6}{7}{8}{9}",a)
if b>0 & substr(l.10,i*3-2,3)=" " then do ; flag2=0
l.9=overlay(" ",l.9,i*3-2,3) ; l.10=overlay(a,l.10,i*3-2,3)
done=done-1 ; signal UPDATE ; end
end i ; call DISPLAY
return
DISPLAY:
tr "2HcdÛcb"l.0"cdÛ"
do i=1 to 9 ; c=substr("9fc9fc9fc",i,1)
tr "ceC"i"cdÛc"c||l.i"cdÛce"i
end i ; tr "CcdÛcb"l.10"cdÛ"
return
DISPLAY2:
tr "f0Ccao1 F A L L O U T 2 . 2 0o0"
tr "CcdÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜn1CcdÛcb"l.0"cdÛ"
do i=1 to 9 ; c=substr("9fc9fc9fc",i,1)
tr "ceC"i"cdÛc"c||l.i"cdÛce"i
end i ; tr "CcdÛcb"l.10"cdÛ"
se "Ccdßßce1cdßßce2cdßßce3cdßßce4cdßßce5cdßßce6cdßß"
tr "ce7cdßßce8cdßßce9cdßß"
tr "6HcfHow to cbPlay cfthe ceGame"
tr "5Hcc~~~~~~~~~~~~~~~~~~~~~"
tr "6HcfMove the numbers at"
tr "5Hthe cetop cfof the box to"
tr "5Hthe cabottom cfof the box"
tr "4Hby c9sliding cfthe cerows cfto"
tr "4Hplace a cdhole cfunder each"
tr "54Hcenumbercf. The game is cawon"
tr "54Hcfwhen you have moved cbALL"
tr "56Hcfnine cenumbers cfto the"
tr "57Hcabottom cfof the box!"
tr "60Hcb- c9Dotoran cb-"
return
SETUP:
do i=1 to 9 ; l.i="°±²°±²°±²°±²°±²°±²°±²°±²°±²"
do k=1 until substr(l.i,r*3-2,3)="°±²"
r=random(1,9,time("s")) ; end k
l.i=overlay(" ",l.i,r*3-2,3)
end i ; l.0="" ; l.10=copies(" ",9)
l0="{1}{2}{3}{4}{5}{6}{7}{8}{9}" ; changewhere "Fall_Out, "ver
do i=1 to 9 ; r1=random(1,length(l0)%3,time("s"))
l.0=l.0||substr(l0,r1*3-2,3) ; l0=delstr(l0,r1*3-2,3)
end i ; flag=0 ; flag2=0 ; turns=0 ; out="" ; done=9
return
exit
CHECK:;if ARG() & ARG(1)~="###PANIC" then return ARG(1)
getcarrier;if result="TRUE" then if ARG() then return ARG(1);else return
logentry "Lost Carrier!!";bufferflush;exit
SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
e2=" Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
bufferflush
/**************************************************************************\
\****************************************** Frontiers BBS (716)/823-9892 **/